initSelect()
function initSelect() {
    let els = document.querySelectorAll('.gd-select')
    els.forEach(item => {
        let str  = ''
        str += '<div class="gd-select-title">' +
            '<div class="label"></div>' +
            '<i class="iconfont icondown1"></i>' +
            '</div>' +
            '<div class="gd-select-wrap"></div>'
        if(!item.innerHTML) {
            item.innerHTML = str
        }
        item.addEventListener('click', (e) => {
            e.stopPropagation()
            document.querySelectorAll('.gd-select-wrap').forEach(wItem => {
                if(item !== wItem.parentNode) {
                    wItem.hide()
                }
            })
            item.querySelector('.gd-select-wrap').toggleShow()
        })
        item.querySelector('.gd-select-wrap').addEventListener('click', e => {
            e.stopPropagation()
        })
        let elTitle = item.querySelector('.gd-select-title')
        elTitle.addEventListener('click', e => {
            elTitle.querySelector('.iconfont').classList.toggle('is-reverse')
        })
    })
    document.body.addEventListener('click', () => {
        document.querySelectorAll('.gd-select-wrap').forEach(item => item.hide())
    })
}
